package com.ericsson.middleware.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ericsson.middleware.dao.ParkingSpotDao;
import com.ericsson.middleware.entities.ParkingSpotState;

@Component
public class ParkingSpotService {

	@Autowired
	private ParkingSpotDao parkingSpotDAO;		
	
	public void save(ParkingSpotState parkingSpot) throws Exception {
		parkingSpotDAO.insert(parkingSpot);
	}

	public void update(ParkingSpotState parkingSpot) throws Exception {
		parkingSpotDAO.update(parkingSpot);
	}

	public ParkingSpotState searchById(String id) throws Exception {
		return parkingSpotDAO.findById(id);
	}	
}